using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._RasterAnalysisTools._UseProximity
{
    /// <summary>
    /// <para>Determine Travel Cost Path As Polyline</para>
    /// <para>Calculates the least-cost polyline path between sources and destinations.</para>
    /// <para>计算源和目标之间的成本最低的折线路径。</para>
    /// </summary>    
    [DisplayName("Determine Travel Cost Path As Polyline")]
    public class DetermineTravelCostPathAsPolyline : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public DetermineTravelCostPathAsPolyline()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_inputSourceRasterOrFeatures">
        /// <para>Input Source Raster or Features</para>
        /// <para><xdoc>
        ///   <para>An image service or feature service that identifies the cells from which the least-cost path is determined to the destinations.</para>
        ///   <para>If the input is an image service, the input consists of cells that have valid values (zero is a valid value), and the remaining cells must be assigned NoData.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一种影像服务或要素服务，用于标识从中确定到目标的开销最低路径的像元。</para>
        ///   <para>如果输入是影像服务，则输入由具有有效值的像元组成（零为有效值），并且必须为其余像元分配 NoData。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_inputCostRaster">
        /// <para>Input Cost Raster</para>
        /// <para><xdoc>
        ///   <para>The name of a cost raster image service to be used to determine the least-cost path from the sources to the destinations.</para>
        ///   <para>The value at each cell location represents the cost-per-unit distance for moving through the cell. Each cell location value is multiplied by the cell resolution while also compensating for diagonal movement to obtain the total cost of passing through the cell.</para>
        ///   <para>The values of the cost raster can be integer or floating point, but they cannot be negative or zero (you cannot have a negative or zero cost).</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定从源到目标的最低成本路径的成本栅格影像服务的名称。</para>
        ///   <para>每个像元位置的值表示在像元中移动的单位距离成本。每个像元位置值乘以像元分辨率，同时还补偿对角线移动，以获得通过像元的总成本。</para>
        ///   <para>成本栅格的值可以是整数或浮点，但不能为负数或零（不能为负数或零成本）。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_inputDestinationRasterOrFeatures">
        /// <para>Input Destination Raster or Features</para>
        /// <para>An image service or feature service that identifies the cells to which the least-cost path is calculated.</para>
        /// <para>一种影像服务或要素服务，用于标识要计算开销最低路径的像元。</para>
        /// </param>
        /// <param name="_outputPolylineName">
        /// <para>Output Polyline Name</para>
        /// <para><xdoc>
        ///   <para>The name of the output polyline feature service.</para>
        ///   <para>The polyline feature service of the optimum (least-cost) paths connecting sources and destinations.</para>
        ///   <para>Each path (or line) is uniquely numbered, and has an additional field in the attribute table called DestID, which connects it back to the unique identifier on the destination raster.</para>
        ///   <para>Since each path is represented by a unique line, there can be multiple lines in locations where paths travel the same route.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出折线要素服务的名称。</para>
        ///   <para>连接源和目标的最佳（最低成本）路径的折线要素服务。</para>
        ///   <para>每条路径（或线）都具有唯一编号，并且在属性表中具有一个名为 DestID 的附加字段，该字段将其连接回目标栅格上的唯一标识符。</para>
        ///   <para>由于每条路径都由一条唯一的线表示，因此在路径沿同一路线行驶的位置可以有多条线。</para>
        /// </xdoc></para>
        /// </param>
        public DetermineTravelCostPathAsPolyline(object _inputSourceRasterOrFeatures, object _inputCostRaster, object _inputDestinationRasterOrFeatures, object _outputPolylineName)
        {
            this._inputSourceRasterOrFeatures = _inputSourceRasterOrFeatures;
            this._inputCostRaster = _inputCostRaster;
            this._inputDestinationRasterOrFeatures = _inputDestinationRasterOrFeatures;
            this._outputPolylineName = _outputPolylineName;
        }
        public override string ToolboxName => "Raster Analysis Tools";

        public override string ToolName => "Determine Travel Cost Path As Polyline";

        public override string CallName => "ra.DetermineTravelCostPathAsPolyline";

        public override List<string> AcceptEnvironments => ["cellSize", "extent", "mask", "outputCoordinateSystem", "snapRaster"];

        public override object[] ParameterInfo => [_inputSourceRasterOrFeatures, _inputCostRaster, _inputDestinationRasterOrFeatures, _outputPolylineName, _pathType.GetGPValue(), _outputPolylineFeatures, _destinationField];

        /// <summary>
        /// <para>Input Source Raster or Features</para>
        /// <para><xdoc>
        ///   <para>An image service or feature service that identifies the cells from which the least-cost path is determined to the destinations.</para>
        ///   <para>If the input is an image service, the input consists of cells that have valid values (zero is a valid value), and the remaining cells must be assigned NoData.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一种影像服务或要素服务，用于标识从中确定到目标的开销最低路径的像元。</para>
        ///   <para>如果输入是影像服务，则输入由具有有效值的像元组成（零为有效值），并且必须为其余像元分配 NoData。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Source Raster or Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputSourceRasterOrFeatures { get; set; }


        /// <summary>
        /// <para>Input Cost Raster</para>
        /// <para><xdoc>
        ///   <para>The name of a cost raster image service to be used to determine the least-cost path from the sources to the destinations.</para>
        ///   <para>The value at each cell location represents the cost-per-unit distance for moving through the cell. Each cell location value is multiplied by the cell resolution while also compensating for diagonal movement to obtain the total cost of passing through the cell.</para>
        ///   <para>The values of the cost raster can be integer or floating point, but they cannot be negative or zero (you cannot have a negative or zero cost).</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定从源到目标的最低成本路径的成本栅格影像服务的名称。</para>
        ///   <para>每个像元位置的值表示在像元中移动的单位距离成本。每个像元位置值乘以像元分辨率，同时还补偿对角线移动，以获得通过像元的总成本。</para>
        ///   <para>成本栅格的值可以是整数或浮点，但不能为负数或零（不能为负数或零成本）。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Cost Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputCostRaster { get; set; }


        /// <summary>
        /// <para>Input Destination Raster or Features</para>
        /// <para>An image service or feature service that identifies the cells to which the least-cost path is calculated.</para>
        /// <para>一种影像服务或要素服务，用于标识要计算开销最低路径的像元。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Destination Raster or Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputDestinationRasterOrFeatures { get; set; }


        /// <summary>
        /// <para>Output Polyline Name</para>
        /// <para><xdoc>
        ///   <para>The name of the output polyline feature service.</para>
        ///   <para>The polyline feature service of the optimum (least-cost) paths connecting sources and destinations.</para>
        ///   <para>Each path (or line) is uniquely numbered, and has an additional field in the attribute table called DestID, which connects it back to the unique identifier on the destination raster.</para>
        ///   <para>Since each path is represented by a unique line, there can be multiple lines in locations where paths travel the same route.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出折线要素服务的名称。</para>
        ///   <para>连接源和目标的最佳（最低成本）路径的折线要素服务。</para>
        ///   <para>每条路径（或线）都具有唯一编号，并且在属性表中具有一个名为 DestID 的附加字段，该字段将其连接回目标栅格上的唯一标识符。</para>
        ///   <para>由于每条路径都由一条唯一的线表示，因此在路径沿同一路线行驶的位置可以有多条线。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Polyline Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _outputPolylineName { get; set; }


        /// <summary>
        /// <para>Path Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the manner in which the values and zones on the input destination data will be interpreted in the cost path calculations.</para>
        ///   <bulletList>
        ///     <bullet_item>To each cell—For each cell or location with valid values on the input destination data, a least-cost path is determined and saved on the output. With this option, each cell or location of the input destination data is treated separately, and a least-cost path is determined for each from cell.</bullet_item><para/>
        ///     <bullet_item>To each zone—For each zone on the input destination data, a least-cost path is determined and saved to the output. With this option, the least-cost path for each zone begins at the location with the lowest cost distance weighting in the zone.</bullet_item><para/>
        ///     <bullet_item>Best single—For all locations on the input destination data, the least-cost path is derived from the location with the minimum of the least-cost paths to source locations. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定在成本路径计算中解释输入目标数据的值和区域的方式。</para>
        ///   <bulletList>
        ///     <bullet_item>对于每个像元 - 对于输入目标数据上具有有效值的每个像元或位置，将确定一个开销最低的路径并将其保存在输出中。使用此选项时，将单独处理输入目标数据的每个单元格或位置，并为每个从单元格确定成本最低的路径。</bullet_item><para/>
        ///     <bullet_item>到每个区域 - 对于输入目标数据上的每个区域，将确定一个成本最低的路径并将其保存到输出中。使用此选项时，每个区域的最低成本路径从区域中成本距离权重最低的位置开始。</bullet_item><para/>
        ///     <bullet_item>最佳单条路径 - 对于输入目标数据上的所有位置，成本最低的路径是从源位置的最低成本路径中具有最小成本的位置派生的。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Path Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _pathType_value _pathType { get; set; } = _pathType_value._BEST_SINGLE;

        public enum _pathType_value
        {
            /// <summary>
            /// <para>To each cell</para>
            /// <para>To each cell—For each cell or location with valid values on the input destination data, a least-cost path is determined and saved on the output. With this option, each cell or location of the input destination data is treated separately, and a least-cost path is determined for each from cell.</para>
            /// <para>对于每个像元 - 对于输入目标数据上具有有效值的每个像元或位置，将确定一个开销最低的路径并将其保存在输出中。使用此选项时，将单独处理输入目标数据的每个单元格或位置，并为每个从单元格确定成本最低的路径。</para>
            /// </summary>
            [Description("To each cell")]
            [GPEnumValue("EACH_CELL")]
            _EACH_CELL,

            /// <summary>
            /// <para>To each zone</para>
            /// <para>To each zone—For each zone on the input destination data, a least-cost path is determined and saved to the output. With this option, the least-cost path for each zone begins at the location with the lowest cost distance weighting in the zone.</para>
            /// <para>到每个区域 - 对于输入目标数据上的每个区域，将确定一个成本最低的路径并将其保存到输出中。使用此选项时，每个区域的最低成本路径从区域中成本距离权重最低的位置开始。</para>
            /// </summary>
            [Description("To each zone")]
            [GPEnumValue("EACH_ZONE")]
            _EACH_ZONE,

            /// <summary>
            /// <para>Best single</para>
            /// <para>Best single—For all locations on the input destination data, the least-cost path is derived from the location with the minimum of the least-cost paths to source locations. This is the default.</para>
            /// <para>最佳单条路径 - 对于输入目标数据上的所有位置，成本最低的路径是从源位置的最低成本路径中具有最小成本的位置派生的。这是默认设置。</para>
            /// </summary>
            [Description("Best single")]
            [GPEnumValue("BEST_SINGLE")]
            _BEST_SINGLE,

        }

        /// <summary>
        /// <para>Output Polyline Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Polyline Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _outputPolylineFeatures { get; set; }


        /// <summary>
        /// <para>Destination Field</para>
        /// <para><xdoc>
        ///   <para>The field used to obtain values for the destination locations.</para>
        ///   <para>Input feature data must contain at least one valid integer field.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于获取目标位置值的字段。</para>
        ///   <para>输入要素数据必须至少包含一个有效的整数字段。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Destination Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _destinationField { get; set; } = null;


        public DetermineTravelCostPathAsPolyline SetEnv(object cellSize = null, object extent = null, object mask = null, object outputCoordinateSystem = null, object snapRaster = null)
        {
            base.SetEnv(cellSize: cellSize, extent: extent, mask: mask, outputCoordinateSystem: outputCoordinateSystem, snapRaster: snapRaster);
            return this;
        }

    }

}